<?php

namespace catchAdmin\pc\tables;

use catchAdmin\pc\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class SysLabel extends CatchTable
{

    public function Table()
    {
        return $this
            ->getTable('sysLabel')
            ->header([
                HeaderItem::label('类型')
                    ->prop('company_type_name'),
                HeaderItem::label('标签名称')
                    ->prop('label_name'),
                HeaderItem::label('操作')
                    ->actions([
                        Actions::update(),
                        Actions::delete(),
//                        Actions::normal('查看详情', 'zz3', 'tongguoshenhe', 'el-icon-s-tools'),

                    ])
                    ->width(260),
            ])
            ->withSearch([
                Search::label('类型')
                    ->select('company_type', '选择企业类型', tableSelectArray((new \catchAdmin\model\SysLabel())->getCompanyTypeNameList()))
                    ->style(['width' => '100px']),
                Search::label('标签名称')
                    ->text('label_name', '标签名称')
                    ->clearable(true),
//                Search::label('行业')->text('vocation_name', '行业')->clearable(true),
            ])
            ->selectionChange()
            ->withApiRoute('sysLabel')
            ->withActions([
//                Actions::update(),
                Actions::create(),
//                Actions::export(),
            ])
            ->render();
    }


    public function form()
    {
        return Factory::create('sysLabel');
    }

}
